use crate::mod_base::{os_autolaunch, os_sysinfo};

#[tauri::command]
pub fn get_sys_info_cmd() -> os_sysinfo::OsSysInfo {
    os_sysinfo::OsSysInfo::get_info()
}

#[tauri::command]
pub fn set_autolaunch_cmd(enable: bool) {
    os_autolaunch::Osys::global().init_launch().unwrap();
    os_autolaunch::Osys::global().update_launch(enable).unwrap();
    println!("set_autolaunch_cmd:{}", enable);
}

#[tauri::command]
pub fn select_folder_cmd() -> String {
    if let Some(path) = rfd::FileDialog::new().pick_folder() {
        return path.display().to_string();
    }
    return "".to_string();
}
